Matthias Clasen [Mon, 5 Jun 2023 01:44:37 +0000 (21:44 -0400)]
searchentry: Improve size allocation
We want to always reserve space for the clear icon,
but let the text widget use that space when the icon
isn't shown. A plain box layout can't do that, so
do our own size allocation.
Benjamin Otte [Wed, 24 May 2023 14:55:18 +0000 (16:55 +0200)]
vulkan: Create multiple render objects
Sometimes the GPU is still busy when the next frame starts (like when
no-vsync benchmarking), so we need to keep all those resources alone and
create new ones.
That's what the render object is for, so we just create another one.
However, when we create too many, we'll starve the CPU. So we'll limit
it. Currently, that limit is at 4, but I've never reached it (I've also
not starved the GPU yet), so that number may want to be set lower/higher
in the future.
Note that this is different from the number of outstanding buffers, as
those are not busy on the GPU but on the compositor, and as such a
buffer may have not finished rendering but have been returend from the
compositor (very busy GPU) or have finished rendering but not been
returned from the compositor (very idle GPU).
Benjamin Otte [Mon, 22 May 2023 02:21:02 +0000 (04:21 +0200)]
vulkan: Add a hackish way to handle empty children
For blend and crossfade nodes, one of the children may exist and
influence the rendering, while the other does not.
Previously, we would skip the node, which would cause the required
rendering to not happen. We now send a valid texture id for the
invalid offscreen, thereby actually rendering the required parts.
Fixes the blend-invisible-child compare test
Current state for compare tests:
Ok: 397
Expected Fail: 0
Fail: 26
Unexpected Pass: 0
Skipped: 2
Timeout: 0
Benjamin Otte [Fri, 19 May 2023 03:35:18 +0000 (05:35 +0200)]
vulkan: Clip using scissors
If we have a rectangular clip without transforms, we can use
scissoring. This works particularly well because it allows intersecting
rounded rectangles with regular rectangles in all cases:
Use the scissor rect for the rectangle and the normal clipping code for
the rounded rectangle.
Benjamin Otte [Fri, 19 May 2023 01:08:43 +0000 (03:08 +0200)]
vulkan: Make scissoring an explicit operation
The idea is to use it for clip nodes when they are integer-aligned.
To do that, we need to track the scissor rect in the parse state, so we
do that, too.
Also move the viewport offset out of the projection matrix, as it is
part of the transform between clip and scissor, so it needs to live in
the offset.
Benjamin Otte [Thu, 18 May 2023 21:22:25 +0000 (23:22 +0200)]
vulkan: Align vertex data
We align the data to a multiple of vertex stride, that way we use more
memory, but we could compute an offset into the vertex buffer without
changing the offset.
Benjamin Otte [Thu, 18 May 2023 21:10:16 +0000 (23:10 +0200)]
vulkan: Set offsets when counting
We can set the vertex offset while counting the data, this gets rid of
the need of passing all the counting machinery into the actual data
collection code.
The idea is that for a rectangle intersection, each corner of the
result is either entirely part of one original rectangle or it is
an intersection point.
By detecting those 2 cases and treating them differently, we can
simplify the code to compare rounded rectangles.
Benjamin Otte [Sat, 13 May 2023 01:14:16 +0000 (03:14 +0200)]
vulkan: Rewrite AA shaders to respect scale
The border and color shaders - the ones that do AA - now multiply their
coordinates by the scale factor, which gives them better rounding
capabilities.
This in particular improves the case where they are used in fractional
scaling situations, where the scale is defined at the root element.
Benjamin Otte [Fri, 12 May 2023 13:23:02 +0000 (15:23 +0200)]
vulkan: Use scale factor for offscreens and fallbacks
Previously, we just used the defaultscale factor, but now that we're
having it available in push constants, we can read it back for creating
offscreens and rendering fallbacks.
Benjamin Otte [Wed, 10 May 2023 15:55:56 +0000 (17:55 +0200)]
vulkan: Add a static assert
We don't want to make the push constants larger than what the spec
guarantees. And that is 128 bytes, see value for
maxPushConstantsSize in table 55 of
https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits-minmax
Benjamin Otte [Fri, 5 May 2023 07:29:47 +0000 (09:29 +0200)]
vulkan: Render whole texture
When the node bounds were a non-integer size, the texture would get
ceil()ed pixels, but various viewport or scissor computations might
floor() instead, leaving the right/bottom row of pixels untouched.
Make sure those functions ceil(), too.
Benjamin Otte [Sat, 3 Jun 2023 16:00:56 +0000 (18:00 +0200)]
glx: Trap errors inside loop
Instead of trapping errors for the whole loop trying to create GL
contexts, trap them once per GL context.
Apparently GLX does throw an error when a too high version is requested
and doesn't just return NULL and then that error lingers when we try
lower versions.
x11: Trap XRandr errors when getting outputs during init and update
We may try to update the XRR outputs and Crtcs when they're changing in
the server, and so we may get BadRROutput that we're currently not
handling properly.
As per this, use traps and check whether we got errors, and if we did
let's ignore the current output.
It's not required to call init_randr13() again because if we got errors
it's very likely that there's a change coming that will be notified at
next iteration during which we'll repeat the init actions.
sumibi-yakitori [Thu, 1 Jun 2023 07:43:57 +0000 (16:43 +0900)]
The GL version reported by epoxy seems to depend on the current GL context, so the GL context to create should be the one determined by `gdk_gl_context_get_matching_version`
actionmuxer: Correctly notify actions after reparenting
When registering an observer, we send a notification and for that we need
to query the action's state and param type. When setting up a muxer parent,
same thing happens, except the action is queried on the parent instead.
This means that the muxer will notify observers about the parent's actions,
but not about its own.
Matthias Clasen [Wed, 31 May 2023 18:33:52 +0000 (14:33 -0400)]
gsk: Support straight alpha textures
This is not the optimal way of doing it: we're
reuploading the texture with client-side conversion.
But it fits nicely into our current handling of mipmaps.
We can do better once we use shaders for colorspace
conversions.